﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL_MechSysWeb;
using DTO_MechSysWeb;

namespace WEB_MechSysWeb.Paginas_Logado
{
    public partial class NoticiaImagem : System.Web.UI.Page
    {
        BLLNoticia bllNoticia = new BLLNoticia();
        DTONoticia dtoNoticia = new DTONoticia();


        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["id"].ToString()))
                {
                    string id = Request.QueryString["id"];

                    dtoNoticia = bllNoticia.BuscarNoticiaPorNoticiaID(Convert.ToInt32(id));

                    byte[] imgDados = dtoNoticia.Imagem;
                    Response.ContentType = dtoNoticia.ImagemTipo;
                    Response.OutputStream.Write(imgDados, 0, imgDados.Length);

                }
            }
            catch
            { }
        }
    }
}